// //  ********************************************************************************
// //  Copyright (C) 2016 Sebastian Kenter. All rights reserved.
// // 
// //  Name    : MultiServerEngine | ServerFramework | Parameter.cs
// //  Created : 2016 - 02 - 19 14:00
// //  Modified: 2016 - 02 - 20 12:32
// //  ********************************************************************************

using System;

namespace ServerFramework.Implementation.Database.Domain
{
    public class Parameter_T
    {
        public virtual string Parkompgrp { get; set; }
        public virtual string Pargrp { get; set; }
        public virtual string Parkey { get; set; }
        public virtual string Parvalue { get; set; }
        public virtual string Parvaluemin { get; set; }
        public virtual string Parvaluemax { get; set; }
        public virtual string Pardescription { get; set; }
        public virtual string Parinfo { get; set; }
        public virtual DateTime Dtins { get; set; }
        public virtual DateTime Dtupd { get; set; }
        public virtual string Namupd { get; set; }
        public virtual string Tsn { get; set; }

        #region NHibernate Composite Key Requirements

        public override bool Equals(object obj)
        {
            Parameter_T t = obj as Parameter_T;
            if (t == null) return false;
            if (Parkompgrp == t.Parkompgrp
                && Pargrp == t.Pargrp
                && Parkey == t.Parkey)
                return true;

            return false;
        }

        public override int GetHashCode()
        {
            int hash = GetType().GetHashCode();
            hash = (hash*397) ^ Parkompgrp.GetHashCode();
            hash = (hash*397) ^ Pargrp.GetHashCode();
            hash = (hash*397) ^ Parkey.GetHashCode();

            return hash;
        }

        #endregion
    }
}
